local ENCHANTED_CRYSTAL = {CRYSTAL_ICE = 7759, CRYSTAL_FIRE = 7760, CRYSTAL_EARTH = 7761, CRYSTAL_ENERGY = 7762}
local WEAPONS_ICE = {[2383] = {7763}, [7406] = {7766}, [7402] = {7767}, [7383] = {7764}, [7384] = {7765}, [2429] = {7768}, [2430] = {7769}, [7380] = {7771}, [7389] = {7770}, [2454] = {7772}, [2423] = {7773}, [2445] = {7774}, [7392] = {7776}, [7415] = {7775}, [2391] = {7777}} 
local WEAPONS_FIRE = {[2383] = {7744}, [7406] = {7747}, [7402] = {7748}, [7383] = {7745}, [7384] = {7746}, [2429] = {7749}, [2430] = {7750}, [7380] = {7752}, [7389] = {7751}, [2454] = {7753}, [2423] = {7754}, [2445] = {7755}, [7392] = {7757}, [7415] = {7756}, [2391] = {7758}} 
local WEAPONS_EARTH = {[2383] = {7854}, [7406] = {7857}, [7402] = {7858}, [7383] = {7855}, [7384] = {7856}, [2429] = {7859}, [2430] = {7860}, [7380] = {7862}, [7389] = {7861}, [2454] = {7863}, [2423] = {7864}, [2445] = {7865}, [7392] = {7867}, [7415] = {7866}, [2391] = {7868}} 
local WEAPONS_ENERGY = {[2383] = {7869}, [7406] = {7872}, [7402] = {7873}, [7383] = {7870}, [7384] = {7871}, [2429] = {7874}, [2430] = {7875}, [7380] = {7877}, [7389] = {7876},[2454] = {7878}, [2423] = {7879}, [2445] = {7880}, [7392] = {7882}, [7415] = {7881}, [2391] = {7883}}

function onUse(cid, item, frompos, item2, topos)
	if((item.itemid == ENCHANTED_CRYSTAL.CRYSTAL_ICE) and (WEAPONS_ICE[item2.itemid]))then
		doTransformItem(item.uid, WEAPONS_ICE[item2.itemid][1], 1000)
		doRemoveItem(item2.uid, 1)
	elseif((item.itemid == ENCHANTED_CRYSTAL.CRYSTAL_ENERGY) and (WEAPONS_ENERGY[item2.itemid]))then
		doTransformItem(item.uid, WEAPONS_ENERGY[item2.itemid][1], 1000)
		doRemoveItem(item2.uid, 1)
	elseif((item.itemid == ENCHANTED_CRYSTAL.CRYSTAL_FIRE) and (WEAPONS_FIRE[item2.itemid]))then
		doTransformItem(item.uid, WEAPONS_FIRE[item2.itemid][1], 1000)
		doRemoveItem(item2.uid, 1)
	elseif((item.itemid == ENCHANTED_CRYSTAL.CRYSTAL_EARTH) and (WEAPONS_EARTH[item2.itemid]))then
		doTransformItem(item.uid, WEAPONS_EARTH[item2.itemid][1], 1000)
		doRemoveItem(item2.uid, 1)
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return TRUE
end